/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.transas.zorlog.data;

import java.text.NumberFormat;

/**
 *
 * @author amalikov
 */
public class TimeFormatterHMS implements TimeFormatter {

	@Override
	public String get(double value) {
		double sec = value;
		final int hour = (int)sec / (60 * 60);
		sec -= hour * (60 * 60);
		final int min = (int)sec / 60;
		sec -= min * 60;
		
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMinimumIntegerDigits(1);
		String str = nf.format(hour) + ":";
		nf.setMinimumIntegerDigits(2);
		str += nf.format(min) + ":";
		str += nf.format(sec);
		return str;
	}
}
